package com.etc.entity;

import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * (History)实体类
 *
 * @author makejava
 * @since 2021-10-18 22:32:00
 */
@Component
public class History  {
    private static final long serialVersionUID = -79367972912129041L;
    /**
     * 历史记录
     */
    private String historyId;
    /**
     * 用户
     */
    private User userId;
    /**
     * 视频
     */
    private Video videoId;
    /**
     * 直播间
     */
    private Room roomId;
    /**
     * 时间记录
     */
    private String viewDate;


    public String getHistoryId() {
        return historyId;
    }

    public void setHistoryId(String historyId) {
        this.historyId = historyId;
    }

    public User getUserId() {
        return userId;
    }

    public void setUserId(User userId) {
        this.userId = userId;
    }

    public Video getVideoId() {
        return videoId;
    }

    public void setVideoId(Video videoId) {
        this.videoId = videoId;
    }

    public Room getRoomId() {
        return roomId;
    }

    public void setRoomId(Room roomId) {
        this.roomId = roomId;
    }

    public String getViewDate() {
        return viewDate;
    }

    public void setViewDate(String viewDate) {
        this.viewDate = viewDate;
    }

    public History() {
    }

    public History(String historyId, User userId, Video videoId, Room roomId, String viewDate) {
        this.historyId = historyId;
        this.userId = userId;
        this.videoId = videoId;
        this.roomId = roomId;
        this.viewDate = viewDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        History history = (History) o;
        return Objects.equals(historyId, history.historyId) &&
                Objects.equals(userId, history.userId) &&
                Objects.equals(videoId, history.videoId) &&
                Objects.equals(roomId, history.roomId) &&
                Objects.equals(viewDate, history.viewDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(historyId, userId, videoId, roomId, viewDate);
    }

    @Override
    public String toString() {
        return "History{" +
                "historyId='" + historyId + '\'' +
                ", userId=" + userId +
                ", videoId=" + videoId +
                ", roomId=" + roomId +
                ", viewDate='" + viewDate + '\'' +
                '}';
    }
}

